home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 9 / CDACTUAL9.iso / share / Dos / VARIOS / pascal / SWAG9605.DDD / 0060_Slow Down your PC for games.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1996-05-31  |  1.0 KB  |  63 lines

  1. {
  2. TSR to slow down your PC so that games that run too fast
  3. can be playable!
  4.  
  5.  
  6. Feel free to distribute!
  7. }
  8.  
  9.  
  10.  
  11. {$M $800,0,0 }   { 2K stack, no heap }
  12.  
  13. uses Crt, Dos;
  14. var
  15.   KbdIntVec  : Procedure;
  16.   WaitPeriod : Word;
  17.   ErrorPos   : integer;
  18.  
  19. {$F+}
  20.  
  21.  
  22.  
  23. procedure DelayRoutine; interrupt;
  24. begin
  25.   asm cli end;
  26.   delay(WaitPeriod);
  27.   asm sti end;
  28.   asm PUSHF end;
  29.   { Call old ISR using saved vector }
  30.   KbdIntVec;
  31. end;
  32.  
  33.  
  34.  
  35.  
  36. {$F-}
  37. begin
  38.   If ParamCount = 1 Then
  39.      Begin
  40.      Val (ParamStr(1),WaitPeriod,ErrorPos);
  41.      If ErrorPos = 0 Then
  42.         Begin
  43.         { Insert ISR into keyboard chain }
  44.         GetIntVec($8,@KbdIntVec);
  45.         SetIntVec($8,Addr(DelayRoutine));
  46.         Writeln;
  47.         Writeln('DELAY installed !');
  48.         Writeln;
  49.         Keep(0); { Terminate, stay resident }
  50.      End;
  51.      End
  52.   Else
  53.       Begin
  54.       Writeln;
  55.       Writeln('DELAY (C) 1995 Scott Tunstall.');
  56.       Writeln;
  57.       Writeln('DELAY <Number of millisecs to slow computer by> ');
  58.       Writeln;
  59.       End;
  60. end.
  61.  
  62.  
  63.